<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%
	String id = request.getParameter("id");
	if (id == null) {
		id = "";
	}
%>
<script type="text/javascript">
$(function(){
	
		
	<% if(id!=""){%>

	 $.post('${ctx}/autoinn/coupon/update/ser?id=' +$(':input[name="couponId"]').val(), {
			id : $(':input[name="couponId"]').val(),
		}, function(result) {
			if (result.couponId != undefined) {
				//alert(result.status+" 和"+result.remarks+"还有"+result.sort);
				$('form').form('load', {
				
					'couponId' : result.couponId,
					'couponName' :result.couponName,
					'couponPrice' : result.couponPrice,
					'couponType' :result.couponType,
					'couponCount' : result.couponCount,
					'coupinDes' : result.coupinDes,
					'state' : result.state,
					'startime' : result.startime,
					'endtime' : result.endtime,
					'souponQi' : result.souponQi,
					'couponzhi' : result.couponzhi
 					
				});
			 //alert(result.lid);
				//$('#iconCls').attr('class', result.iconCls);//设置背景图标
			}
			$.messager.progress('close');
		}, 'json');
	 
<%}%>
}); 		
</script>
<div align="center" id="dicoupon">
	<form id="coupon_updateForms" method="post" class="zzld_form">

		<input type="hidden" id="couponId" name="couponId" value="<%=id %>" />
		<br />
		<table class="zzld_table" cellpadding="1" cellspacing="1"
			style="width: 100%">
			<tr>
				<th>活动名称：</th>
				<td><input id="couponName" name="couponName"
					value="" class="easyui-validatebox" data-options="required:true"
					missingMessage="请编辑活动名称!" style="width: 98%;" /></td>

				</td>

			</tr>
			<tr>
				<th>优惠钱数(折扣):</th>
				<td><input id="couponPrice" name="couponPrice"
					value="" class="easyui-validatebox" data-options="required:true"
					missingMessage="请编辑优惠钱数(折扣)!" style="width: 155px;" /></td>

			</tr>
			<tr>
				<th>活动类型:</th>
				<td><select name="couponType" id="couponType">
						<option value="0">代金卷</option>
						<option value="1">折扣卷</option>
				</select></td>
			</tr>
			<tr>
				<th>状态:</th>
				<td><select name="state">
						<option value="1">启用</option>
						<option value="0">未启用</option>
				</select></td>
			</tr>
			<tr>
			<th>发放类型：</th>
			<td>
				<select name="couponzhi">
					<option value="0">绑定送券</option>
					<option value="1">充值送券</option>
					<option value="2">消费送卷</option>
					<option value="3">人工发放</option>
					<option value="4">推广送券</option>
				</select>
			    </td>
			</tr>

			<tr>

				<th>数量:</th>
				<td><input name="couponCount" value=""
					class="easyui-validatebox" data-options="required:true"
					missingMessage="请填写数量!" style="width: 73%;" /></td>
			<tr>
				<th>活动时间:</th>
				<td><input name="startime" class="Wdate"
					onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
					readonly="readonly" style="width: 120px;" />-<input name="endtime"
					class="Wdate"
					onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
					readonly="readonly" style="width: 120px;" /></input></td>

			</tr>

			<tr>
				<th>有效期:</th>
				<td><input name="souponQi" value=""
					class="easyui-validatebox" data-options="required:true"
					missingMessage="请填写原价!" style="width: 73%;" /></td>
			</tr>
			<tr>
				<th>描述信息：</th>
				<td colspan="3"><textarea name="coupinDes"
						rows="3" cols="52" style="width: 98%;"></textarea></td>
			</tr>

		</table>

	</form>
</div>
